/**
 * Created by James on 14-3-13.
 */
var exp = module.exports;

exp.connector = function(session, msg, app, cb){
  if(!session){
      cb(new Error("fail to route to connector server for session is empty"));
      return;
  }

  if(!session.frontendId){
      cb(new Error("fail to find frontend id in session"));
      return;
  }

  cb(null, session.frontendId);
};
//
//var dispatcher = require('./dispatcher');
//
//exp.room = function(session, msg, app, cb){
//    var roomServers = app.getServersByType('room');
//
//    if(!roomServers || roomServers.length === 0){
//        cb(new Error('can not find room servers.'));
//        return;
//    }
//
//    var res = dispatcher.dispatch(session.get('rid'), roomServers);
//
//    cb(null, res.id);
//}